<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>  
<%@ page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">
<head>
<title>个人资料管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="gb2312" />
<link href="skin1/css/header.css" type="text/css" rel="stylesheet"/>
<link href="skin1/css/invite.css" type="text/css" rel="stylesheet"/>
<link href="skin1/css/public.css" type="text/css" rel="stylesheet"/>
<script type='text/javascript' src='dwr/interface/ProvinceService.js'></script>
<script type='text/javascript' src='dwr/interface/CityService.js'></script>
<script type='text/javascript' src='dwr/interface/RegionService.js'></script>
<script type='text/javascript' src='dwr/util.js'></script>
<script type='text/javascript' src='dwr/engine.js'></script>
</head>
<body>
<div class=pageContent>

<jsp:include flush="true" page="../include/header.jsp"></jsp:include>

<div class=main>
<div class=mainLeft2>
<div class="tp7 tp7n">
  <h3>个人资料</h3>
  <div id="iv"><img src="upload/headphoto/${sessionScope.user.photoURL}" alt="img" width="70" /><span>昵 称：</span>${sessionScope.user.username}<br/>
		<span>等 级：</span><strong>${sessionScope.user.userData.grade }</strong> 级<br/>
		<span>人 气：</span><strong>${sessionScope.user.userData.popularity }</strong> 点<br/>
		<span>积 分：</span><strong>${sessionScope.user.userData.score }</strong> 分<br/>
		<span>心 情：</span>
<select name="select" style="width: 75px;">
  <option selected="selected">好</option>
</select>
<br/>
		<span>签 名：</span><c:out value="${sessionScope.user.signment}"/></div>
</div>
<div class="tp7">
  <h3>功&nbsp;能</h3>
  <ul class="iv1">
    <li><a href="#">我的评论</a>&nbsp;[10]</li>
    <li><a href="#">我的留言</a>&nbsp;[10]</li>
    <li><a href="#">我的话题</a>&nbsp;[10]</li>
    <li><a href="#">我的请求</a>&nbsp;[10]</li>
    <li><a href="#">我的消息</a>&nbsp;[10]</li>
    <li><a href="#">我的活动</a>&nbsp;[10]</li>
  </ul>
  </div>
<div class="tp7">
  <h3>谁来看过我</h3>
  <div id="iv2"><a href="#">谁看我</a> <a href="#">我看谁</a> <a href="#">随机配</a><br/><img src="skin1/images/user01.jpg" alt="img" width="53"/><img src="skin1/images/user01.jpg" alt="img" width="53"/><img src="skin1/images/user01.jpg" alt="img" width="53"/><img src="skin1/images/user01.jpg" alt="img" width="53"/></div>
</div>
</div>

<div class=mainright2>
<div class="tp7 tp7n">
  <h3>详细资料</h3>
  
  <form action="user.do?method=updateMyInfo" method="post" id="form1">
  <div id="zl">
  
  	<div><label>昵 称：</label><input type="text" class="fmx" name="username" value="${sessionScope.user.username }"/>
  	</div>
  	
    <div><label>出生日期：</label><input type="text" class="fmx"name="chooseBirthday" value='<fmt:formatDate value="${sessionScope.user.birthday}" pattern="yyyy-MM-dd"/>'/>
    </div>
    <div><a href="#">搜索和你同城的人</a>
      <label>所在地区：</label><select name="province" id="province" onchange="findCity();"> <option>省/市</option></select> - 
      <select name="city" id="city" onchange="findRegion();"><option  selected="selected">市/地区</option></select> - 
      <select name="region" id="region"> <option selected="selected">县/市</option></select></div>
  
    <div><a href="#">搜索你的老乡</a>
    <label>故 乡：</label><select name="countryProCode" id="countryProCode" onchange="findCountryCity();"> <option>省/市</option></select> - 
    <select name="countryCityCode" id="countryCityCode" onchange="findCountryRegion();"><option  selected="selected">市/地区</option></select> - 
    <select name="countryRegCode" id="countryRegCode"><option>县/市</option></select>
    </div>
  
    <div><a href="#">搜索和你爱好一样的人</a>
    <label>爱 好：</label>
    <select name="hobbyOne">
		<option value="保密">保密</option>
		<option value="时尚">时尚</option>
		<option value="旅游">旅游</option>
		<option value="电影">电影</option>
		<option value="音乐">音乐</option>
		<option value="体育">体育</option>
		<option value="美食">美食</option>
		<option value="交友">交友</option>
		<option value="文学">文学</option>
		<option value="艺术">艺术</option>
		<option value="游戏">游戏</option>
		<option value="政治">政治</option>
		<option value="购物">购物</option>
		<option value="上网">上网</option>
		<option value="健身">健身</option>
		<option value="美容">美容</option>
		<option value="宠物">宠物</option>
		<option value="篮球">篮球</option>
		<option value="足球">足球</option>
		<option value="网球">网球</option>
		<option value="游泳">游泳</option>
		<option value="电视">电视</option>
		<option value="乒乓球">乒乓球</option>
		<option value="跳舞">跳舞</option>
		<option value="收藏">收藏</option>
		<option value="KTV">KTV</option>
  	</select>
	<select name="hobbyTwo">
		<option value="保密">保密</option>
		<option value="时尚">时尚</option>
		<option value="旅游">旅游</option>
		<option value="电影">电影</option>
		<option value="音乐">音乐</option>
		<option value="体育">体育</option>
		<option value="美食">美食</option>
		<option value="交友">交友</option>
		<option value="文学">文学</option>
		<option value="艺术">艺术</option>
		<option value="游戏">游戏</option>
		<option value="政治">政治</option>
		<option value="购物">购物</option>
		<option value="上网">上网</option>
		<option value="健身">健身</option>
		<option value="美容">美容</option>
		<option value="宠物">宠物</option>
		<option value="篮球">篮球</option>
		<option value="足球">足球</option>
		<option value="网球">网球</option>
		<option value="游泳">游泳</option>
		<option value="电视">电视</option>
		<option value="乒乓球">乒乓球</option>
		<option value="跳舞">跳舞</option>
		<option value="收藏">收藏</option>
		<option value="KTV">KTV</option>
	</select>
	
	</div>
  
    <div><label>学 历：</label>
    <select class="fmx" name="education"> 
      	<option value="0">保密</option>
		<option value="1">初中</option>
		<option value="2">高中</option>
		<option value="3">大专</option>
		<option value="4">大学本科</option>
		<option value="5">硕士</option>
		<option value="6">博士</option>
    </select>
    </div>
    
    <div><a href="#">搜索和你职业一样的人</a>
      <label>职 业：</label><input type="text" name="job" value="${sessionScope.user.job}"/>
    </div>
    <div><a href="#">搜索和你爱情一样的人</a>
    
      <label>爱情状况：</label>
	<select name="marriage" class="fmx"> 
		<option value="0">寻爱中</option>
		<option value="1">单身中</option>
		<option value="2">恋爱中</option>
		<option value="3">已婚</option>
  
	</select>
    </div>
    
    <div><label>体 型：</label>
    <select name="body" class="fmx"> 
      	<option value="0">保密</option>
		<option value="1">苗条</option>
		<option value="2">匀称</option>
		<option value="3">健壮</option>
		<option value="4">高大</option>
		<option value="5">小巧</option>
		<option value="6">丰满</option>
		<option value="7">高挑</option>
		<option value="8">较胖</option>
		<option value="9">较瘦</option>
		<option value="10">运动型</option>
		<option value="11">残缺的美</option>
  </select>
    </div>
    <div><label>个人签名：</label><input class="fmx"name="signment" value='<c:out value="${sessionScope.user.signment}"/>'/>
    </div>
    
    <div><a href="#">查看自我介绍模板</a>
      <label>自我介绍：</label>
      <iframe src="user/Edit.html?I=introduction&B=contentBg" frameborder="0" marginheight="0" marginwidth="0" style="height:200px;width:630px"></iframe>
    	<input type="hidden" name="introduction" style="width:800px;height:100px" value="${sessionScope.user.introduction }"></input>
		<input type="hidden" value="" name="contentBg" size=106></input>
    </div>
    
    <div><a href="#">查看添加音乐教程</a><label>我的音乐：</label><textarea name="myMusic" class="fms1">${sessionScope.user.myMusic }</textarea>
    </div>
    
    <div><a href="#">查看偶像模板</a><label>我的偶像：</label><textarea class="fms1" name="myIdol">${sessionScope.user.myIdol }</textarea>
    </div>
    <div>
      <label>&nbsp;</label>
      <input type="submit" class="fmbule" value="提 交" />
    </div>
  </form>
  
  </div>
</div>
</div>
<div class="clear"></div>
<jsp:include flush="true" page="../include/footer.jsp"></jsp:include>

</div>
<script type="text/javascript">


var hobby = "${sessionScope.user.hobby}";
var hobbyArray = hobby.split(",");
var hobbyOne = hobbyArray[0];
var hobbyTwo = hobbyArray[1];


document.all.hobbyOne.value= hobbyOne;
document.all.hobbyTwo.value= hobbyTwo;
				document.all.education.value="${sessionScope.user.education}";
				document.all.marriage.value="${sessionScope.user.marriage}";
				document.all.body.value="${sessionScope.user.body}";
				document.all.myMusic.value="${sessionScope.user.myMusic}";
				document.all.myIdol.value="${sessionScope.user.myIdol}";


	 var pro="${sessionScope.user.provinceCode}";
		var city="${sessionScope.user.cityCode}";
		var reg="${sessionScope.user.regionCode}";
		var cpro="${sessionScope.user.countryProCode}";
		var ccity="${sessionScope.user.countryCityCode}";
		var creg="${sessionScope.user.countryRegCode}";
		begin();
	
		
        function begin(){
      
       
       
        findPro();
        findCity(pro);
        findRegion(city);
        
       	findCountryPro();
       	findCountryCity(cpro);
       	findCountryRegion(ccity);
        
        }
        function findPro(chos){
		ProvinceService.findAll(backPro);
		
		}
		function backPro(data){
		DWRUtil.removeAllOptions("province");
		DWRUtil.addOptions("province",{'0':'请选择'});
		DWRUtil.addOptions("province", data, "code", "name");
		DWRUtil.setValue("province",pro);
		
		pro="0";
		}
		function findCity(pro){
		var proValue=document.all.province.value;
		if(pro!=null){
		proValue=new Number(pro);
		}
		CityService.findByProvince(proValue,backCity); 
		}
		function backCity(data){
		DWRUtil.removeAllOptions("city");
		DWRUtil.addOptions("city",{'0':'请选择'});
		DWRUtil.addOptions("city", data, "code", "name");
		DWRUtil.setValue("city",city);
		city="0";
		}
		function findRegion(city){
		var cityValue=document.all.city.value;
		if(city!=null){
		cityValue=new Number(city);
		}
		RegionService.findByCity(cityValue,backRegion);
		}
		function backRegion(data){
		DWRUtil.removeAllOptions("region");
		DWRUtil.addOptions("region",{'0':'请选择'});
		DWRUtil.addOptions("region", data, "code", "name");
		DWRUtil.setValue("region",reg);
		reg="0";
		
		}
			
        function findCountryPro(){
		ProvinceService.findAll(backCountryPro);
		}
		function backCountryPro(data){
		DWRUtil.removeAllOptions("countryProCode");
		DWRUtil.addOptions("countryProCode",{'0':'请选择'});
		DWRUtil.addOptions("countryProCode", data, "code", "name");
		DWRUtil.setValue("countryProCode",cpro);
		cpro=0;
		}
		function findCountryCity(cpro){
		var proValue=document.all.countryProCode.value;
		if(cpro!=null){
			proValue=cpro;
		}
		CityService.findByProvince(proValue,backCountryCity); 
		}
		function backCountryCity(data){
		DWRUtil.removeAllOptions("countryCityCode");
		DWRUtil.addOptions("countryCityCode",{'0':'请选择'});
		DWRUtil.addOptions("countryCityCode", data, "code", "name");
		DWRUtil.setValue("countryCityCode",ccity);
		ccity=0;
		}
		function findCountryRegion(ccity){
		var cityValue=document.all.countryCityCode.value;
		if(ccity!=null){
			cityValue=ccity;
		}
		RegionService.findByCity(cityValue,backCountryRegion);
		}
		function backCountryRegion(data){
		DWRUtil.removeAllOptions("countryRegCode");
		DWRUtil.addOptions("countryRegCode",{'0':'请选择'});
		DWRUtil.addOptions("countryRegCode", data, "code", "name");
		DWRUtil.setValue("countryRegCode",creg);
		creg=0;
		}
		</script>
</body>
</html>
